package com.zxjbyte.yiyi.framework.web.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.List;

/**
 * Web 相关配置属性类
 *
 * @Author zhangxingjia
 * @Date 2023/4/4 16:56
 * @Version: 1.0
 */
@Getter
@Setter
@ConfigurationProperties(prefix = XssProperties.XSS_PROP_PREFIX)
public class XssProperties {

    public static final String XSS_PROP_PREFIX = "yiyi.xss";

    /**
     * 开启xss
     */
    private Boolean enabled = true;

    /**
     * 输出详细日志
     */
    private Boolean logDetails = false;

    /**
     * 模式：
     * clear 清理（默认）
     * escape 转义
     */
    private Mode mode = Mode.clear;

    /**
     * 放行的路由，默认为空
     */
    private List<String> excludePaths = new ArrayList<>();

    public enum Mode {
        clear, escape
    }
}
